Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
gov000
Posts: 112
Registered: ‎06-22-2013
My Device: blackberry z10
Accepted Solution

Html table width not working

my code is below

 

 

My html code is given below:

 

<html>
 <head>
  <style type='text/css'>
    A.navcontent {
    FONT-WEIGHT: bold;
    COLOR: black;
    TEXT-DECORATION:none
    }
    navcontent {
    FONT-WEIGHT: bold;
    COLOR: black;
    TEXT-DECORATION:none
    }
    A {
    FONT-WEIGHT: bold;
    COLOR: black;
    FONT-SIZE: 10pt;
    TEXT-DECORATION: underline
    }
    body {
     TEXT-ALIGN: left;
    }
  </style>
  <title>Alerts</title>
 </head>
 <body>
  
<table align="left">
   <tr>
    <td>
     

 

 

 

<b>  details for: ABC</b>

<table width="100%">
 <tr>
  <td align="left">&nbsp;</td>
  <td align="left">&nbsp;</td>
  <td align="left">&nbsp;</td>
 </tr>
 <tr valign=top>
  <td align="left" valign=top width="30%"><b>Reference&nbsp;</b></td>
  <td align="left" valign=top width="40%"><b>User&nbsp;&nbsp;</b></td>
  <td align="left"  style="white-space:nowrap;" valign=top width="30%"><b>Msg&nbsp;Value&nbsp;&nbsp;</b></td>
 </tr>
 <tr valign=top>
  <td align="left" valign=top width="30%"><b>&nbsp;</b></td>
  <td align="left" valign=top width="40%"><b>MSG Type&nbsp;</b></td>
  <td align="left" valign=top width="30%"><b>&nbsp;</b></td>
 </tr>
 <tr valign="top">
  <td colspan="3" style="background-color: Black;"></td>
 </tr>
 
  <tr valign=top>
   <td align="left" valign=top width="30%">100100284&nbsp;</td>
   <td align="left" valign=top width="40%">XYZ super CO&nbsp;&nbsp;</td>
   <td align="left" valign=top width="30%">631&nbsp;&nbsp;</td>
  </tr>
  <tr valign=top>
   <td align="left" valign=top width="30%">&nbsp;</td>
   <td align="left" valign=top width="40%">Last St Acknowledgement</td>
   <td align="left" valign=top width="30%">&nbsp;</td>
  </tr>
  <tr valign="top">
   <td colspan="3" style="background-color: #867D7E;"></td>
  </tr>
 
  <tr valign=top>
   <td align="left" valign=top width="30%">500234587&nbsp;</td>
   <td align="left" valign=top width="40%">ABC STORES&nbsp;&nbsp;</td>
   <td align="left" valign=top width="30%">19&nbsp;&nbsp;</td>
  </tr>
  <tr valign=top>
   <td align="left" valign=top width="30%">&nbsp;</td>
   <td align="left" valign=top width="40%">Testing</td>
   <td align="left" valign=top width="30%">&nbsp;</td>
  </tr>
  <tr valign="top">
   <td colspan="3" style="background-color: #867D7E;"></td>
  </tr>
 
  
 
</table>

<table>
 
 <tr>
  <td>
   <a href="#">
    <b>Home</b>
   </a>
  </td>
 </tr>
</table>

 </td>
   </tr>
  </table>
 </body>
</html>

BlackBerry Development Advisor
anzor_b
Posts: 165
Registered: ‎09-24-2012
My Device: Passport

Re: Html table width not working

gov000,

 

Your table is set to 100%, but body and html don't have dimensions, so the table does not know what 100% means.

 

Try this:

body,html{
    width:100%;
    height:100%;
}

table {
    width: 100%; /* or use table width="100" */
}

 

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Html table width not working

Hello gov000, did anzor_b's response answer your question? If so, can you please Accept as Solution for his reply?

If not, please let us know and we'll do our best to help.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.