Skip to main content
Participant
April 27, 2013
Question

How to adjust the cell width in the table

  • April 27, 2013
  • 1 reply
  • 457 views

How can the width of the cell in a table for ADE be adjusted ?

I wrote the following HTML code in a ePub file.

<table style="width:100%;border-collapse: collapse;">

        <tr><td style="width:25%">red</td>

<td style="width:75%">red</td></tr>

      </table>

But, the created table runs over the page at the right side in the ADE (see figure). The values of widths in the both td tags are set to 50% and the same result is got.  However, with no set of the values the table fits in the page.

Why? How should I do?

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 27, 2013

    Try adding "margin: 0;" to the table style (or to parent elements of the table)

    In case you don't know already, itis easy to play quickly with HTML at a site like http://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic

    However, that won't reflect the 'outer' environment imposed by different browsers, eReaders etc.

    The more explicit you make your HTML (eg explicit margin) rather than leaving it to environment support,

    the more likely it is to appear the same (within reason of size etc) on all browsers/devices.

    Probably worth making a fairly extensive style of your defaults that applies at the <doc> level.