如何使用html基于表内容增加图像大小? [英] How to increase image size based on table contents using html?

查看:66
本文介绍了如何使用html基于表内容增加图像大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已创建一个表。我创建一个表,但在第一个表内部创建表。



第一个表:我添加了一个图像。
第二个表:我写了一些内容。



内容很大,所以第二个表增加,但第一个表和图像没有增加。所以如何增加图像大小。 / p>

我使用以下代码:

 < html& 
& lt; head>
< style type =text / css>
body {
font-family:Calibri;
}


表tr {
border:none;
}

a,a:link,a:visited,a:active {
text-decoration:none;
color:#09B0CE;
}

img {
border:none;
width:100%;
height:auto;
}
< / style>
< /头>

< body>
< table cellspacing =1cellpadding =0align =centerid =main-panelstyle =width:100%; background-color:#f2f2f2; color:rgb 75,75); border-collapse:collapse; border:1px solid#f2f2f2;>
< tbody>

< td>
< table align =centerwidth =640pxstyle =width:640px; padding:2px 0px 2px 0px; background-color:#17B8DD>
< tbody>
< tr>
< td style =width:100%;>
< table>
< tr>
< td width =85%style =padding-top:10px>
< a href =http://www.s.com>
< img src =http://KB/logo.pngalt =S.INC style =height:auto; width:autosizes =80vw/>
< / a>
< / td>
< / tr>
< / table>
< / td>
< / tr>
< / tbody>
< / table>
< / td>
< / tr>
< tr>
< td style =padding:0px 0px 0px 0px;>

< table style =color:#4D4D4D; font-size:14px; font-weight:normal; width:100%; border:1px solid #cccccc; padding:10px 0px 10px 20px;border =1pxcellspacing =2cellpadding =3>
< tbody>
< tr style =padding:10px 10px 5px 10px; >
< th style =width:32%>控制< / th>
< th style =width:36%>测试用例名称< / th>
< th style =width:32%>状态< / th>
< / tr>

< tr style =padding:10px 10px 5px 10px ;>
< th style =width:32%> EnterpriseServer< / th>
< th style =width:36%> AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail< / th>
< th style =width:32%>失败< / th>
< / tr>
< / tbody>
< / table>
< / td>
< / tr>

< / tbody>
< / table>


解决方案

试试

 < table cellspacing =1cellpadding =0align =centerid =main-panelstyle =width:100%; background- color:#f2f2f2; color:rgb(75,75,75); border-collapse:collapse; border:1px solid#f2f2f2;> 
< tbody>
< tr>

< td>
< table align =centerwidth =style =width:100%; padding:2px 0px 2px 0px; background-color:#17B8DD>
< tbody>
< tr>
< td style =width:100%;>
< table>
< tbody>< tr>
< td width =style =padding-top:10px>
< a href =http://www.s.com>
< img src =http://dakhal.net/Archieves/2/image/news_image_98.jpegalt =S.INC style =width =100%>
< / a>
< / td>
< / tr>
< / tbody>< / table>
< / td>
< / tr>
< / tbody>
< / table>
< / td>
< / tr> < tr> < td style =padding:0px 0px 0px 0px;>

< table style =color:#4D4D4D; font-size:14px; font-weight:normal; width:100%; border:1px solid #cccccc; padding:10px 0px 10px 20px; 。 border =1pxcellspacing =2cellpadding =3>
< tbody>
< tr style =padding:10px 10px 5px 10px;>
< th style =width:32%>控制< / th>
< th style =width:36%>测试用例名称< / th>
< th style =width:32%>状态< / th>
< / tr> < tr style =padding:10px 10px 5px 10px;>
< th style =width:32%> EnterpriseServer< / th>
< th style =width:36%> AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail< / th>
< th style =width:32%>失败< / th>
< / tr>
< / tbody>
< / table>
< / td>
< / tr>

< / tbody>
< / table>


I have Created one table.Again I create one table but table created at inside of the first table.

First table : I added one image. second table : I write some content.

content is large so second table increase but first table and images not increased.so how to increase image size.

I used following code :

<html>
   <head>
    <style type="text/css">
        body {
            font-family: Calibri;
        }


        table tr {
            border: none;
        }

        a, a:link, a:visited, a:active {
            text-decoration: none;
            color: #09B0CE;
        }

         img {
            border: none;
            width: 100%;
            height: auto;
        }
      </style>
   </head>

     <body>
                    <table cellspacing="1"  cellpadding="0" align="center" id="main-panel"     style="width: 100%; background-color:#f2f2f2; color: rgb(75, 75, 75); border-collapse: collapse; border: 1px solid #f2f2f2;">
        <tbody>
            <tr>

                <td >
                    <table  align="center" width="640px" style="width: 640px; padding: 2px 0px 2px 0px; background-color: #17B8DD">
                        <tbody>
                            <tr>
                                <td style="width:100%;">
                                    <table>
                                        <tr>
                                            <td width="85%" style="padding-top:10px">
                                                <a href="http://www.s.com">
                                                <img src="http://KB/logo.png" alt="S.INC style="height:auto; width:auto" sizes="80vw"/>
                                                </a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
 <tr>
                <td style="padding: 0px 0px 0px 0px;">

                    <table style="color: #4D4D4D; font-size: 14px; font-weight: normal; width: 100%; border:1px solid #cccccc; padding: 10px 0px 10px 20px;" border="1px" cellspacing="2" cellpadding="3">
                        <tbody>
                            <tr style="padding: 10px 10px 5px 10px;">
                                <th style="width: 32%">Control</th>
                                <th style="width: 36%">Test Case Name</th>
                                <th style="width: 32%">Status</th>
                            </tr>

                           <tr style="padding: 10px 10px 5px 10px;">
                                <th style="width: 32%">EnterpriseServer</th>
                                <th style="width: 36%">AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail</th>
                            <th style="width: 32%">Failed</th>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>

         </tbody>
         </table>

解决方案

try this

<table cellspacing="1" cellpadding="0" align="center" id="main-panel" style="width: 100%; background-color:#f2f2f2; color: rgb(75, 75, 75); border-collapse: collapse; border: 1px solid #f2f2f2;">
    <tbody>
        <tr>

            <td>
                <table align="center" width="" style="width:100% ; padding: 2px 0px 2px 0px; background-color: #17B8DD">
                    <tbody>
                        <tr>
                            <td style="width:100%;">
                                <table>
                                    <tbody><tr>
                                        <td width="" style="padding-top:10px">
                                            <a href="http://www.s.com">
                                            <img src="http://dakhal.net/Archieves/2/image/news_image_98.jpeg" alt="S.INC style=" width="100%">
                                            </a>
                                        </td>
                                    </tr>
                                </tbody></table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr> <tr> <td style="padding: 0px 0px 0px 0px;">

                <table style="color: #4D4D4D; font-size: 14px; font-weight: normal; width: 100%; border:1px solid #cccccc; padding: 10px 0px 10px 20px;" border="1px" cellspacing="2" cellpadding="3">
                    <tbody>
                        <tr style="padding: 10px 10px 5px 10px;">
                            <th style="width: 32%">Control</th>
                            <th style="width: 36%">Test Case Name</th>
                            <th style="width: 32%">Status</th>
                        </tr>                      <tr style="padding: 10px 10px 5px 10px;">
                            <th style="width: 32%">EnterpriseServer</th>
                            <th style="width: 36%">AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail</th>
                        <th style="width: 32%">Failed</th>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>

     </tbody>
     </table>

这篇关于如何使用html基于表内容增加图像大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆