Html2pdf Table Width

Browser Support. The numbers in the table specify the first browser version that fully supports the property. Page-break-inside, 1.0, 8.0, 19.0, 1.3, 7.0.

Page 1 of 1
[ 4 posts ]
Print viewPrevious topic Next topic
AuthorMessage
Posted: Wed Jul 21, 2010 3:55 am
Forum Commoner

Joined: Wed Feb 10, 2010 1:56 am
Posts: 48
Hi all,
I am using html2pdf class file to convert html output to pdf file.
my problem is the table width is changing according to the rows from the db.
i dont know why
can any one trace the problem here?
thanks in advance.


Top
Post subject:Re: problem in table width in html2pdf
Forum Regular

Joined: Sun Dec 29, 2002 6:40 pm
Posts: 908
Location: VA
You need to set a fixed width on your table -- but even then that won't 100% guarantee the width. If you have a long string of text with no spaces to break it apart it will force the table cell to be larger even with your fixed width.


Top
Post subject:Re: problem in table width in html2pdf
Forum Commoner

Joined: Wed Feb 10, 2010 1:56 am
Posts: 48
Thanks for your reply.
No other ways to go?


Top
Post subject:Re: problem in table width in html2pdf
Forum Regular

Joined: Sun Dec 29, 2002 6:40 pm
Posts: 908
Location: VA
Sure.. don't write so many rows per line, or force your data to have a space (or truncate) after a certain number of characters.


Top
Page 1 of 1
[ 4 posts ]

Example

A simple HTML table, with two table cells:

Ecs rc410-m motherboard drivers for mac. RC410 M DRIVERS FOR MAC DOWNLOAD - This port connects a headphone or a speaker. How does HP install software and gather data? Europe, Middle East, Africa. Two USB connectors supporting 2. The RCM Asterope3 motherboard. In 4-channel, 6-channel, and 8-channel mode, the function of this port becomes Front Speaker Out. Best Selling in Motherboards See. RC410 M SOUND DRIVERS FOR MAC After changing or clearing the BIOS passwords, remember to reset the jumper to pins Motherboard description Manufacturer’s motherboard name: Damage to the motherboard can result. This page requires Javascript. The RCM Asterope3 motherboard. Driver Name: RealTek onboard LAN driver. Version: 6.73: Release Date: 2007/07/12: Update Description: RealTek onboard LAN driver: Special Note: 1.6V: File Size.

<table>
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
Try it Yourself »

More 'Try it Yourself' examples below.

Definition and Usage

The <td> tag defines a standard cell in an HTML table.

An HTML table has two kinds of cells:

  • Header cells - contains header information (created with the <th> element)
  • Standard cells - contains data (created with the <td> element)

The text in <th> elements are bold and centered by default.

The text in <td> elements are regular and left-aligned by default.

Browser Support

Element
<td>YesYesYesYesYes

Attributes

AttributeValueDescription
colspannumberSpecifies the number of columns a cell should span
headersheader_idSpecifies one or more header cells a cell is related to
rowspannumberSets the number of rows a cell should span

Global Attributes

The <td> tag also supports the Global Attributes in HTML.

Event Attributes

The <td> tag also supports the Event Attributes in HTML.

More Examples

Example

How to align content inside <td> (with CSS):

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »

Example

How to add background-color to table cell (with CSS):

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it Yourself »

Example

How to set the height of a table cell (with CSS):

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it Yourself »

Example

How to specify no word-wrapping in table cell (with CSS):

<table>
<tr>
<th>Poem</th>
<th>Poem</th>
</tr>
<tr>
<td>Never increase, beyond what is necessary, the number of entities required to explain anything</td>
<td>Never increase, beyond what is necessary, the number of entities required to explain anything</td>
</tr>
</table>
Try it Yourself »

Example

How to vertical align content inside <td> (with CSS):

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it Yourself »

Example

How to set the width of a table cell (with CSS):

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it Yourself »

Example

How to create table headers:

<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
<tr>
<td>John Doe</td>
<td>john.doe@example.com</td>
<td>123-45-678</td>
</tr>
</table>
Try it Yourself »

Example

How to create a table with a caption:

<table>
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »

Example

How to define table cells that span more than one row or one column:

<table>
<tr>
<th>Name</th>
<th>Email</th>
<th colspan='2'>Phone</th>
</tr>
<tr>
<td>John Doe</td>
<td>john.doe@example.com</td>
<td>123-45-678</td>
<td>212-00-546</td>
</tr>
</table>
Try it Yourself »

Related Pages

HTML tutorial: HTML Tables

HTML DOM reference: TableData Object

Coreldraw graphics suite 12. CSS Tutorial: Styling Tables

Default CSS Settings

Most browsers will display the <td> element with the following default values:

td {
display: table-cell;
vertical-align: inherit;
}