Inside of a table cell I have a span with left padding. In Firefox, when the
table width gets sized to its content - either by shrinking the viewport or
constraining the table width - the text inside the span is rendered outside
of the cell. This doesn't happen when I substitute margin for padding, but
my goal is to put an icon in front of the text and I want to use a
background image, which means I need padding. This will eventually display
in a large datagrid, so I can expect the text to wrap. Here is sample code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd";>
<html>
  <head>
    <title>Padded Element Inside Table Cell Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style type="text/css">

body {
  margin: 20px;
  background: #ccc;
}

table {
  width: 100px;
  border: 1px solid #000;
  background: #fff;
}

td {
  border: 1px solid #000;
  padding: 0px;
}

span {
  padding-left: 30px;
}

    </style>
  </head>
  <body>
    <table>
      <tbody>
        <tr>
          <td><span>Testing the text wrap</span></td>
          <td>Testing the text wrap</td>
        </tr>
        <tr>
          <td>Testing the text wrap</td>
          <td>Testing the text wrap</td>
        </tr>
      </tbody>
    </table>
  </body>
</html>

Any ideas on how to keep the text in the cell are much appreciated.

Brian

-- 
Brian Jamieson
[EMAIL PROTECTED]
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to