function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nhashimotonhashimoto 

テーブルのヘッダーの列の結合について

お世話になっております。橋本と申します。

VisualForceにてテーブルのヘッダーの列を結合しようとしたのですが、うまくいきません。

(過去headerColspanというのがあったようですが、Ver16で廃止されたようです。)

現在のバージョンでのやり方をご教授願います。

 

※下記のヘッダ「1」、ヘッダー「2」を結合し、ヘッダ「1」だけにしたい。

 

<apex:form >
    <apex:dataTable value="{!contacts}"
        var="c" styleClass="dayTable">
        <apex:column >
            <apex:facet name="header">
                <b>&nbsp;</b>
            </apex:facet>
            {!c.name}
        </apex:column>
        <apex:column >
            <apex:facet name="header">
                <b>1</b>
            </apex:facet>
            &nbsp;
        </apex:column>
        <apex:column >
            <apex:facet name="header">
                <b>2</b>
            </apex:facet>
            &nbsp;
        </apex:column>
    </apex:dataTable>
</apex:form>

 

 

MfukahoriMfukahori

HTMLタグとVisualforceタグを両方利用する下記の方法はいかがでしょうか?

 

<table class="dayTable" border="1" cellspacing="0">
      <tr>
          <th><b>&nbsp;</b></th>
          <th colspan ="2"><b>1</b></th>
      </tr>
      <apex:repeat value="{!contacts}" var="c">
          <tr>
              <td>{!c.name}</td>
              <td>data1</td>
              <td>data2</td>
          </tr>
      </apex:repeat>
  </table>

nhashimotonhashimoto

ありがとうございます。

できればVisualForceの機能で実現したかったのですが。。