使TH等于HTML中的3列

时间:2017-08-29 13:10:51

标签: html

enter image description here您好,我想让ACTIONS等于三列

如图所示,我希望在细节更新删除

的中心进行操作

请帮忙。

2 个答案:

答案 0 :(得分:2)

<Style TargetType="{x:Type TextBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <!-- Modify default template, to change triggers -->
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

尝试搜索<table border=1> <tr> <th>NAME</th> <th>AGE</th> <th colspan="3">ACTIONS</th> </tr> <tr> <td>Salman Mushtaq</td> <td>27</td> <td><a href="#">Detail</a></td> <td><a href="#">Update</a></td> <td><a href="#">Delete</a></td> </tr> <tr> <td>Muhanmmad Awais</td> <td>32</td> <td><a href="#">Detail</a></td> <td><a href="#">Update</a></td> <td><a href="#">Delete</a></td> </tr> </tr> <tr> <td>Imran Hassan</td> <td>38</td> <td><a href="#">Detail</a></td> <td><a href="#">Update</a></td> <td><a href="#">Delete</a></td> </tr> </tr> <tr> <td>Muhammad Asad</td> <td>33</td> <td><a href="#">Detail</a></td> <td><a href="#">Update</a></td> <td><a href="#">Delete</a></td> </tr> </table>colspan

答案 1 :(得分:1)

colspan标记中使用TH属性(即。colspan="3"

        <table border="1">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Age</th>
                    <th colspan="3">Action (spanned 3 cols)</th>                        
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>1</td>
                    <td>2</td>
                    <td>action 1</td>
                    <td>Action 2</td>
                    <td>Action 3</td>
                </tr>
            </tbody>
        </table>