Skip to main content
Participating Frequently
January 19, 2018
Answered

column widths appear wider than they should

  • January 19, 2018
  • 1 reply
  • 1144 views

when I create a table, I add column to have vertical line dividers. I assign them to be 1 pt wide. Coding shows them as 1 pt wide. However when viewed browser, they appear wider than 1 pt. What am I doing wrong. How can I fix?

example code:

<td width="1" bgcolor="#FF9900"> </td> -- this is what I want as a think line divider. But shows wider than 1pt.  Thanks for any help!!

<table width="550" border="0">

<tr>

    <td colspan="4"><hr></td>

  </tr>

<tr>

   <td width="164"><a href="http://corp.abc.com"><img name="" src="https://www.thinkedu.com/images/thinkEDU-logo_tag_noncom_150.jpg" width="150" height="61" alt="ThinkEDU Logo"></a></td>

   <td width="1" bgcolor="#FF9900"> </td>

   <td width="9" valign="top"><br></td>

   <td width="358" valign="top"><font size="1" color="000000" face="Verdana, Arial, Helvetica, sans-serif"><strong>Allan David | Chief Operating Officer</strong><br>

     ABC, LLC | www.xyz.com<br>

   </font></td>

</tr>

</table>

This topic has been closed for replies.
Correct answer BenPleysier

1pt = 1.33333333333px

Having said that, eachbrowser has default settings of its own. Sometimes they may be the same across browsers, sometimes they differ. For that reason, many developers use a so called CSS reset.

To illustrate the default setting of the browser for a table cell, add the following style rules to your document.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

<style>

td {

margin: 0;

padding: 0;

}

</style>

</head>

1 reply

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
January 20, 2018

1pt = 1.33333333333px

Having said that, eachbrowser has default settings of its own. Sometimes they may be the same across browsers, sometimes they differ. For that reason, many developers use a so called CSS reset.

To illustrate the default setting of the browser for a table cell, add the following style rules to your document.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

<style>

td {

margin: 0;

padding: 0;

}

</style>

</head>

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
B i r n o u
Legend
January 20, 2018

Hello Ben,

could you detail the report that you install between the relation pixel / point on the one hand and the reinitialization of the defaults of properties css on the other hand.

B i r n o u
Legend
January 20, 2018

I do not have a separate CSS for print. If I include a report to be printed out, then I convert this to a PDF which leans itself more to printing than HTML

As an example, after filling out all of the details in the various tabs as in

how great is a hard copy

This could never be achieved by printing an HTML document.


I don't understand what couldn't be printed that way using CSS ??

anyway when converting to PDF you will have to also convert the display rendering... so what be done using PDF engine could also be done using CSS rendering don't you think ?

FWIT when one is using a PDF workflow is because one need to dematerialize the content and distribute it on that format... when someone print a document it is generally because this person need to get the content on a paper sheet... and that's why CSS print can be usefull... don't you think ?

(above are just questions, to share and exchange point of view, not argue)