Solved

set the font fit to the box html /css

Posted on 2008-06-16
2
202 Views
Last Modified: 2012-06-27
i plane to put the customername and address into <td>customername?address</td> in case the leter to long how can I make it  fit with table by reduce size of leter the name and the address i get form php
i plane to make a invoice and I use table to make evey item fit on each table
<table width="1224" height="269" border="1">
  <tr>
    <td>customer/name</td>
    <td>&nbsp;</td>
  </tr>
</table>

Open in new window

0
Comment
Question by:teera
2 Comments
 
LVL 17

Assisted Solution

by:jasonsbytes
jasonsbytes earned 100 total points
ID: 21797828
check the strlen of the string and if it's over you max lenght use
preg_replace() to stip out or strip off characters from the end of the string.
0
 
LVL 4

Accepted Solution

by:
sajay_j earned 400 total points
ID: 21798989
I hope the following is a fix for your problem...
Regards Sajay.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<title></title>
<style>
<!--
body { font-family:Verdana; margin: 0 auto; }
 
.leftdata, .rightdata { font-size:100%; text-align:justify; padding:10px; }
-->
</style>
</head>
 
<body>
<table width="100%" border="1">
  <tr>
    <td class="leftdata">customer/name</td>
    <td class="rightdata">sdfdsfdsfasfas asdfdasfdasfdasfdas<br>
dasfasdfdasfdasfdas</td>
  </tr>
</table>
</body>
</html>
 
 
 
 
/* CSS CODE */
body { font-fanily:Verdana; margin: 0 auto; }
 
.leftdata, .rightdata { font-size:100%; text-align:justify; padding:10px; }

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP query / monitor data from Telnet to MySQL 7 44
How to set the Tinymce Editor image path 4 22
Ajax and PHP 9 29
Responsive Font Size 6 25
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question